home *** CD-ROM | disk | FTP | other *** search
- /* (C) Copyright 1991 Dave Fritsche (wb8zxu), All Rights Reserved.
- *
- * Redistribution and use in source and binary forms are permitted for
- * non-commercial use, provided that the above copyright notice and this
- * paragraph are duplicated in all such forms. THIS SOFTWARE IS PROVIDED
- * ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
- * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE.
- */
- #include <stdio.h>
- #include "screen.h"
-
- mk_domain(fnm)
- unsigned char fnm[];
- {
- FILE *domain;
- unsigned char buf[128];
-
- sprintf(buf, "%s\\%s", path, fnm);
- if (debug)
- {
- printf("***> domain.txt file (%s):\n", buf);
- domain = stdout;
- }
- else
- if ( (domain = fopen(buf, "a")) == NULL )
- {
- printf("\nCan't open \"%s\" for write, aborting!\n\n", buf);
- exit(-1);
- }
-
- fprintf(domain, "%s.\tIN\tA\t%ld.%ld.%ld.%ld\n", callsign,
- ((ip >> 24) & 0xff), ((ip >> 16) & 0xff), ((ip >> 8) & 0xff),
- (ip & 0xff) );
-
- if (!debug)
- fclose(domain);
- }
-